'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SLPESCAPE 3SLP "Jan 16, 2003"
.SH NAME
SLPEscape \- escapes SLP reserved characters
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lslp\fR [ \fIlibrary\fR... ]
#include <slp.h>

\fBSLPError\fR \fBSLPEscape\fR(\fBconst char *\fR\fIpcInBuf\fR, \fBchar**\fR \fIppcOutBuf\fR,
     \fBSLPBoolean\fR \fIisTag\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBSLPEscape()\fR function processes the input string in \fIpcInbuf\fR and
escapes any \fBSLP\fR reserved characters.  If the \fIisTag\fR parameter is
\fBSLPTrue\fR, it then looks for bad tag characters and signals an error if any
are found by returning the \fBSLP_PARSE_ERROR\fR code.  The results are put
into a buffer allocated by the \fBAPI\fR library and returned in the
\fIppcOutBuf\fR parameter. This buffer should be deallocated using
\fBSLPFree\fR(3SLP) when the memory is no longer needed.
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIpcInBuf\fR\fR
.ad
.RS 13n
Pointer to the input buffer to process for escape characters.
.RE

.sp
.ne 2
.na
\fB\fIppcOutBuf\fR\fR
.ad
.RS 13n
Pointer to a pointer for the output buffer with the \fBSLP\fR reserved
characters escaped. It must be freed using \fBSLPFree()\fR when the memory is
no longer needed.
.RE

.sp
.ne 2
.na
\fB\fIisTag\fR\fR
.ad
.RS 13n
When true, checks the input buffer for bad tag characters.
.RE

.SH ERRORS
.sp
.LP
This function or its callback may return any \fBSLP\fR error code. See the
ERRORS section in \fBslp_api\fR(3SLP).
.SH EXAMPLES
.LP
\fBExample 1 \fRConverting Attribute Tags
.sp
.LP
The following example shows how to convert the attribute tag
\fB,tag-example,\fR to on the wire format:

.sp
.in +2
.nf
SLPError err;
char* escaped Chars;

err = SLPEscape(",tag-example,", &escapedChars, SLP_TRUE);
.fi
.in -2

.SH ENVIRONMENT VARIABLES
.sp
.ne 2
.na
\fB\fBSLP_CONF_FILE\fR\fR
.ad
.RS 17n
When set, use this file for configuration.
.RE

.SH SEE ALSO
.sp
.LP
.BR SLPFree (3SLP),
.BR slp_api (3SLP),
.BR slp.conf (5),
.BR slpd.reg (5),
.BR attributes (7),
.BR slpd (8)
.sp
.LP
\fISystem Administration Guide: Network Services\fR
.sp
.LP
Guttman, E.,  Perkins, C., Veizades, J., and Day, M. \fIRFC 2608, Service
Location Protocol, Version 2\fR. The Internet Society. June 1999.
.sp
.LP
Kempf, J. and Guttman, E. \fIRFC 2614, An API for Service Location\fR. The
Internet Society. June 1999.
